package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.service.IMessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.MessageChannel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class StreamController {
	
	@Autowired
	MessageChannel output;
	
	@Autowired
	private IMessageService messageService;
	
	@GetMapping("/send")
	public String sendMessage(){
		String message = messageService.send();
		log.info(message);
		return message;
	}
}
